<%@page import="org.w3c.dom.Document"%>
<%@page import="conectar.Conectar"%>
<%@ page import="java.io.*,java.util.*,java.net.*,java.sql.*" %>
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Registro</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <form method="post">
            <label>tu ife</label>
            <input type="text" name="userife"/>
            <input type="submit" value="Buscar">
            <%
                try {
                    conectar.Conectar miconexion = new Conectar();
                    String dato = request.getParameter("" + "userife");
                    String sql = "select * from persona where IFE =" + dato;
                    ResultSet consulta = miconexion.consulta(sql);
                    consulta.next();

                    out.print("<p>" + "<label for=userfirstnames class=ufname data-icon=u>Primer Nombre</label>"
                            + "<input id=userfirstnames name=userfirstnames type=text value=" + consulta.getString(2) + " disabled=disabled> <br>");
                    out.print("<p>" + "<label for=usersecondnames class=usname data-icon=u>Segundo Nombre</label>"
                            + "<input id=usersecondnames name=usersecondnames type=text value=" + consulta.getString(3) + " disabled=disabled> <br>");
                    out.print("<p>" + "<label for=userlastname class=ulastname data-icon=u>Primer Apellido</label>"
                            + "<input id=userlastname name=userlastname type=text value=" + consulta.getString(4) + " disabled=disabled> <br>");
                    out.print("<p>" + "<label for=userlastname class=ulastname data-icon=u>Segundo Apellido</label>"
                            + "<input id=userlastname name=userlastname type=text value=" + consulta.getString(5) + " disabled=disabled> <br>");
                    out.print("<p>" + "<label for=userdate class=udate data-icon=u>Fecha Nacimiento</label>"
                            + "<input id=userdate name=userdate type=text value=" + consulta.getString(6) + " disabled=disabled> <br>");
                } catch (Exception e) {
                    out.print(e.getMessage());
                }

            %>
        </form>
    </body>
</html>
